// pages/pains/pains.js
Page({
  data: {
    display: 'block',
    more: {},
    num: 18,
    config: true,
    name: ''
  },
  onLoad: function (options) {
    var that = this;
    // 页面初始化 options为页面跳转所带来的参数
    wx.getStorage({
      key: 'userInfo',
      success: function (res) {
        // success
        wx.request({
          url: "http://1.aiym.applinzi.com/aiyouwai.php",
          data: {
            type: "getUserIntegral",
            paras: {
              uid: res.data.uid
            }
          },
          header: { "Content-Type": "application/json" },
          success: function (res) {
            console.log(res.data)
            that.setData({
              more: res.data,
              num: res.data.length
            })
          }
        })
      },

    })




    var name = wx.getStorageSync('nameTitle')
    var that = this;
    that.setData({
      name: name
    })
  },
  // 点击显示更多
  moreThan: function (e) {
    var that = this;
    that.setData({
      display: 'none',
      config: false
    })
    console.log(that.data.more.length)
  },
  // 点击跳转到规则页面
  help: function () {
    wx.navigateTo({
      url: '../rule/rule',
    })
  },
  // 点击跳转到获取积分界面
  agin: function () {
    wx.navigateTo({
      url: '../server/server?Id=' + 0 + '&name=' + this.data.name,
    })
  },
})